<template>
  <div class="smart-regist-check">
    <!-- 面包屑 -->
    <el-card class="box-card box-card-bgcolor">
      <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
        <el-breadcrumb-item :to="{ path: '/main/home' }">当前位置：首页</el-breadcrumb-item>
        <el-breadcrumb-item>厂商信息管理</el-breadcrumb-item>
      </el-breadcrumb>
    </el-card>
    <!-- 待处理事项： -->
    <el-card class="box-card box-card-bgcolor">
      <div slot="header" class="clearfix">
        <i class="el-icon-edit-outline icon-home"></i>
        <span class="home-title-text blue">审核用户信息</span>
      </div>
      <div class="text item">
        <div class="pending-items">
          <el-table
            ref="filterTable"
            :data="tableData"
            stripe
            tooltip-effect="dark"
            style="width: 100%"
            @selection-change="handleSelectionChange">
            <!-- 多选按钮 -->
            <el-table-column
              type="selection"
              width="55"
              class="table-textalign"
            >
            </el-table-column>
            <el-table-column
              prop="id"
              label="序号"
              width="100"
              class="table-textalign"
              >
            </el-table-column>
            <el-table-column
              prop="username"
              label="厂商名称"
              width="200"
              class="table-textalign"
              >
            </el-table-column>
            <el-table-column
              prop="userkind"
              label="厂商类别"
              width="170"
              show-overflow-tooltip
              class="table-textalign">
            </el-table-column>
            <el-table-column
              prop="leader"
              label="负责人"
              width="150"
              show-overflow-tooltip
              class="table-textalign">
            </el-table-column>
            <el-table-column
              prop="userdesc"
              label="厂商说明"
              show-overflow-tooltip
              class="table-textalign">
            </el-table-column>
            <el-table-column label="操作" class="table-textalign">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  type="success"
                  @click="handlePass(scope.$index, scope.row)">通过</el-button>
                <el-button
                  size="mini"
                  type="danger"
                  @click="handleDelete(scope.$index, scope.row)">驳回</el-button>
                  <el-button
                  size="mini"
                  type="info"
                  @click="handleWatch(scope.$index, scope.row)">查看详情</el-button>
              </template>
            </el-table-column>
          </el-table>
          <div style="margin-top: 20px">
            <el-button @click="toggleSelection()">取消选择</el-button>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  name:'registeCheck',
  data() {
      return {
        tableData: [{
          id:1,
          date: '2016-05-03',
          username: '王小虎',
          leader:'张三',
          userdesc:"不可描述",
          userkind:'监控'
        }, {
          id:2,
          date: '2016-05-02',
          username: '王小虎',
          leader:'张三',
          userdesc:"不可描述",
          userkind:'监控'
        }, {
          id:3,
          date: '2016-05-04',
          username: '王小虎',
          leader:'张三',
          userdesc:"不可描述",
          userkind:'监控'
        }, {
          id:4,
          date: '2016-05-01',
          username: '王小虎',
          leader:'张三',
          userdesc:"不可描述",
          userkind:'监控'
        }],
        multipleSelection: []
      }
    },
  methods: {
      toggleSelection(rows) {
        if (rows) {
          rows.forEach(row => {
            this.$refs.multipleTable.toggleRowSelection(row);
          });
        } else {
          this.$refs.multipleTable.clearSelection();
        }
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      formatter(row, column) {
        return row.address;
      },
      filterTag(value, row) {
        return row.tag === value;
      },
      filterHandler(value, row, column) {
        const property = column['property'];
        return row[property] === value;
      }

    }
  }

</script>

<style scoped lang="scss">
  @import '@/assets/css/infomanage.scss'
</style>
